﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NegevGas.Core
{
    internal class ConfigPropertyDefinition
    {
        // Methods
        internal void SetDefaultValue(string value)
        {
            switch (this.Type)
            {
                case ConfigPropertyType.Text:
                    this.DefaultValue = value;
                    break;

                case ConfigPropertyType.Number:
                    this.DefaultValue = Convert.ToInt32(value);
                    break;

                case ConfigPropertyType.Boolean:
                    this.DefaultValue = (value.ToLower() == "true") ? ((object)1) : ((object)(value.ToLower() == "1"));
                    break;
            }
        }

        // Properties
        internal string Alias { get; set; }

        internal object DefaultValue { get; set; }

        internal string Group { get; set; }

        internal int Id { get; set; }

        internal string ModuleName { get; set; }

        internal string Name { get; set; }

        internal ConfigPropertyType Type { get; set; }
    }
    public enum ConfigPropertyType
    {
        Text,
        Number,
        Boolean
    }

 

 



}